package com;

import com.listener.MyApplicationListener;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Repository;

import java.io.PrintStream;
import java.util.List;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        //SpringApplication.run(DemoApplication.class, args);


        SpringApplication application = new SpringApplication(DemoApplication.class);
//        application.setBanner(new Banner() {
//            @Override
//            public void printBanner(Environment environment, Class<?> sourceClass, PrintStream out) {
//                System.out.println(environment + ":" + sourceClass + ":" + out);
//            }
//        });
        application.setBannerMode(Banner.Mode.CONSOLE);
        application.addListeners(new MyApplicationListener());
        application.run(args);


    }

}
